<%@ page language="java" contentType="text/html; charset=UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>骑驴网-${article.title}</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<link rel="icon" href="favicon.ico" type="image/x-icon"/>
	<link rel="shortcut icon" href="favicon.ico" type="image/x-icon"/>
	<link rel="stylesheet" type="text/css" href="css/comm.css">
	<style type="text/css">
		body {
			color: #555;
			font-size: 12px;
		}
		img {
			margin: 0px;
			vertical-align: top;
		}
		#Content {
			line-height: 25px;
			font-size: 14px;
			padding-top: 20px;
		}
		.ContentDiv {
			width: 665px;
			text-align: left;
			padding: 0px 10px 0px 0px;
			font-size: 14px;
			float:left;
			border-right:2px solid #4273B3;
		}
		.rightDiv {
			width: 290px;
			height: auto;
			float: right;
			text-align:left;
			margin: 0px;
			padding: 0px;
		}
		.title {
			font-weight:bold;
			color:#777;
			font-size:13px;
			border-bottom: 1px dotted #DDD;
			padding: 15px 3px 3px 0px;
			margin-bottom: 6px;
		}
		ul, li{
			list-style: none;
			margin: 0px 0px 15px 0px;
			padding: 0px;
		}
	</style>
	<script type="text/javascript" src="js/javer.js"></script>
  </head>
  
  <body>
  	<%@ include file="../header.jsp" %>
    <center>
    <div style="width:980px;text-align:left;margin:10px;border-bottom:2px solid #4273B3;">
    	<img alt="骑驴网" src="images/7lv_trans.png">
    </div>
    <div style="width:980px;">
	    <div class="rightDiv">
	    	<div>
	    		<script src="http://www.gmodules.com/ig/ifr?url=http://bijint.com/bijint.xml&amp;synd=open&amp;w=240&amp;h=320&amp;lang=ja&amp;country=ALL&amp;border=%23ffffff%7C3px%2C1px+solid+%23999999&amp;output=js"></script>
	    	</div>
	    	<div class="title" style="width:90%;">骑驴社区的小龟（点点鼠标喂食吧）</div>
	    	<div>
	    		<object type="application/x-shockwave-flash" style="outline:none;" data="http://hosting.gmodules.com/ig/gadgets/file/112581010116074801021/turtle.swf?" width="250" height="200"><param name="movie" value="http://hosting.gmodules.com/ig/gadgets/file/112581010116074801021/turtle.swf?"></param><param name="AllowScriptAccess" value="always"></param><param name="wmode" value="opaque"></param><param name="scale" value="noscale"/><param name="salign" value="tl"/></object>
	    	</div>
	    	<div class="title" style="width:55%;">您可能感兴趣的话题</div>
	    	<div id="interestTopic"><img src="images/icon/loading.gif">正在加载数据...</div>
	    	<div class="title" style="width:45%;">最新发布的公司</div>
	    	<div id="newCompany"><img src="images/icon/loading.gif">正在加载数据...</div>
	    	<div class="title"  style="width:25%;">广告推广</div>
	    	<div><p>广告推广</p></div>
	    	<%@ include file="/pages/share/qq.jsp" %>
	    </div>
	    <div class="ContentDiv" style="height:auto;">
	    	<div style="text-align:left;font-size:12px;">
		    	<a href="pages/article/main.jsp">职场频道</a>&nbsp;&gt;&gt;&nbsp;
		    	<a href="article.html?method=getArticleByPage&atype=${article.atype}">${articleType[article.atype]}</a>&nbsp;&gt;&gt;&nbsp;
		    	${fn:substring(article.title,0,40)}
		    </div>
	    	<center>
	    		<div style="font-size:22px;font-weight:bold;clear:both;padding-top:20px;">${article.title}</div>
	    		<p>${fn:substring(article.atime,0,19)}&nbsp;&nbsp;&nbsp;&nbsp;来源：${article.comefrom}</p>
	    	</center>
	    	<div style="padding-bottom:15px;"><%@ include file="../share/jiathis.jsp" %></div>
			<div id="Content"><p style="clear:both;">${article.content}</p></div>
			<div style="border-top:1px dotted #DDD;width:98%;margin:0px;padding:0px;"></div>
		     <%-- ############################  公司评论 --%>
		     ${fn:length(comments)>0 ? '<h5>网友评论</h5>' : ''}
		     <c:forEach items="${comments}" var="comment" varStatus="vs">
		     	<div class="companyComent" style=${vs.count%2==0?'background-image:url("images/grey.gif")':''};>
			     	<div class="usertitle">
			     		<span style="float:right;" id="agreeWrapper_${comment.id}">
			     		<script type="text/javascript">
			     			var spanContent1 = '<a href="javascript:agree(${comment.id},${comment.agree},${comment.disagree});">支持(${comment.agree})</a>&nbsp;&nbsp;<a href="javascript:disagree(${comment.id},${comment.agree},${comment.disagree});">反对(${comment.disagree})</a>';
			     			var spanContent2 = '支持(${comment.agree})&nbsp;&nbsp;反对(${comment.disagree})';
			     			if ($.Cookies.get("agreeWrapper_${comment.id}") == 1) {
			     				document.write(spanContent2);
			     			}
			     			else {
			     				document.write(spanContent1);
			     			}
			     		</script>
			     		</span>
			     		<span class="pl_num">${comment.orderNo} </span>楼  来自${comment.uaddress} ${fn:substring(comment.ctime,0,19)} 评论</div>
			     	<div class="commentContent">${comment.content}</div>
			     </div>
		     </c:forEach>
		     <c:if test="${fn:length(comments) >= 5}">
			     <div style="width:90%;text-align:right;">
			     	<a href="comment.html?method=goCommentDetailPage&pageSize=10&tid=${article.id}&ctype=1" target="_blank" style="font-size:13px;color:#0082CA;text-decoration:underline;">&gt;&gt;所有评论</a>
			     </div>
		     </c:if>
		     <div class="companyComent" style="border:0px;">
			     <h5>快速评论</h5><a name="quickComment"></a>
			     <form action="article.html?method=addArticleComment" method="post">
			     	<div style="border:0px solid blue">
			     		<img onmousemove="this.style.backgroundColor='blue'" onmouseout="this.style.backgroundColor='#FFF'" src="images/faces/0.gif" border="0" style="margin:0px;" id="show" onclick="showFace('show','disp');">
			     	</div>
			     	<textarea id="disp" name="content" style="background:url('images/qilv_comment.png') no-repeat; background-position:right bottom;" rows="5" cols="70" alt="notNull1">${param.content}</textarea>
			     	
			     	<input type="hidden" name="tid" value="${param.id}">
			     	<input type="hidden" name="ctype" value="1">
			     	<input type="hidden" name="uip" value="${pageContext.request.remoteAddr}">
			     	<p>
			     	您的IP是：${pageContext.request.remoteAddr}
			     	</p>
			     	验证码：<input type="text" alt="notNull" name="authCode" style="width:100px;" onblur="notNull(this);">
			     	<img id="auth" style="margin-left:20px;" src="pages/share/authcode.jsp?ts=<%=new Date().getTime()%>">
			     	<label style="font-size:12px;">不区分大小写，看不清楚，<a href="javascript:;" onclick="document.getElementById('auth').src='pages/share/authcode.jsp?ts='+new Date().getTime();">换一个</a></label>
			     	<p style="font-size:12px;"><input type="submit" value="提交评论">（请勿发布和主题无关的小广告，否则会无条件被删除）</p>
			     </form>
		     </div>
		     <div></div>
	    </div>
    </div>
    </center>
    <%@ include file="../tailer.jsp" %>
  </body>
  <script type="text/javascript" src="js/validate.js"></script>
  <script type="text/javascript" src="js/comm.js"></script>
  <script type="text/javascript">

  	$("interestTopic").load("article.html?method=getInterestTopicArticle&atype=${article.atype}");
    $("newCompany").load("company.html?method=getNewCompany&limit=1");
   
    function agree(id, num1, num2) {
		doAgree(id, (num1+1), num2);
		$.get("<%=basePath%>comment.html?method=modifyCommentForAgree&agree=1&disagree=0&id="+id);
	}
	
	function disagree(id, num1, num2) {
		doAgree(id, num1, (num2+1));
		$.get("<%=basePath%>comment.html?method=modifyCommentForAgree&agree=0&disagree=1&id="+id);
	}
	
	function doAgree(id, num1, num2) {
		$("agreeWrapper_" + id).html("支持("+ (num1) +")&nbsp;&nbsp;反对("+ num2 +")");
		$.Cookies.set("agreeWrapper_" + id, "1");
	}
	
    // 显示错误信息
  	if ('${error}' != '') {
  		location.hash = "#quickComment";
   		alert('${error}');
   	}
  </script>
  <script type="text/javascript" src="http://v2.jiathis.com/code/jia.js" charset="utf-8"></script>
</html>
